//
//  FirstViewController.m
//  UI_Lesson11.homework
//
//  Created by dllo on 15/11/10.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "FirstViewController.h"
#import "FirstTableViewCell.h"
@interface FirstViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, retain) UITableView *tableView;

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.hidesBarsOnSwipe = YES;
    self.navigationController.navigationBar.barTintColor = [UIColor blackColor];
    self.view.backgroundColor = [UIColor colorWithRed:0.5 green:0.7 blue:0.8 alpha:1];
    
    [self createTableView]
    ;
    
    
    
    
    
    
}
#pragma mark - 创建tableView
- (void)createTableView
{
    self.tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
    
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [self.view addSubview:_tableView];
    [_tableView registerClass:[FirstTableViewCell class] forCellReuseIdentifier:@"tableViewCell"];
    [_tableView release];
    
    
    
    
    
}

#pragma mark - tableView dataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 20;
    
}
#pragma mark - tableViewCell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    FirstTableViewCell *cell = [tableView  dequeueReusableCellWithIdentifier:@"tableViewCell"];
    
    cell.label.text = @"这个妹子真好看";
    cell.photoImageView.image = [UIImage imageNamed:@"ff6b6f21fe08d9cb85167172b5e71e39258feeeb31d3-Xq7Tv1_fw658 (1).jpeg"];
    
    return cell;
    
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
 
    return 100;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
